{extend name="main/index" /}



{block name="main"}
<div class="main-content">
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
        </script>

        <ul class="breadcrumb">
            <i class="icon-home home-icon"></i>
            <li class="active">角色列表</li>
        </ul><!-- .breadcrumb -->
        <div class="nav-search" id="nav-search">
            <form class="form-search" action="{:url('/Role/index')}" method = "post">
                <span class="input-icon">
                    <input type="text" placeholder="Search ..." class="nav-search-input" name="search" id="nav-search-input" autocomplete="off"  />
                    <input type="submit" value="搜索">
                </span>
            </form>
        </div> 
    </div>

    <div class="page-content">
        <h3 class="header smaller lighter blue">角色列表</h3>
        <div class="row">
            <div class="col-xs-12">
                <div class="row">
                    <div class="col-xs-12">
                        
                        <div class="table-responsive">
                            <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>角色名</th>
                                        <th class="hidden-480">角色功能</th>

                                        <th>
                                            <i class="icon-time bigger-110 hidden-480"></i>
                                            角色权限
                                        </th>
                                        <th>状态</th> 
                                        <th class="hidden-480">操作</th>

                                    </tr>
                                </thead>
                                <tbody>
                                {volist name="list" id="v"}
                                    <tr>
                                        <td>{$v['id']}</td>
                                        <td>{$v['name']}</td>
                                        <td>{$v['remark']}</td>
                                        <td style="width:440px; max-height:140px; overflow: hidden; text-overflow:ellipsis; ">

                                            {volist name="v['node']" id = "x"}
                                                <span style="color:#999">
                                                    {volist name="x" id = "z"}
                                                    {$z}
                                                    {/volist}
                                                </span>
                                            {/volist}
                                            <!-- <?php //var_dump($v['node']); exit; ?> -->
                                            <!-- <button data-id="{$v['id']}" class="btn btn-xs btn-primary show-btn" data-toggle="modal" data-target="#myModal" >查看更多</button> -->
                                        </td>
                                        <td>
                                            <?php if ($v['status'] == 1) : ?>
                                                启用
                                            <?php else: ?>
                                                禁用
                                            <?php endif  ?>
                                        </td>
                                        <td style="width:245px;">
                                            <!-- <a href="">删除</a> -->
                                            <a href="{:url('admin/role/edit', ['id' => $v['id']])}" class="btn btn-xs btn-primary">修改</a> | 
                                            <a href="{:url('admin/role/shownode', ['id' => $v['id']])}" class="btn btn-xs btn-primary">分配节点</a> | 
                                            <button data-id="{$v['id']}" class="btn btn-xs btn-primary edit-btn" data-toggle="modal" data-target=".bs-example-modal-sm">查看</button> |
                                            <button data-id="{$v['id']}" class="btn btn-xs btn-danger del-btn">删除</button>
                                        </td>
                                    </tr>
                                {/volist}
                                </tbody>
                            </table>
                        </div>
                        {$page->render()}
                    </div>
                </div>
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
</div>

<!-- Modal -->
<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" style="margin-top: 100px">
  <div class="modal-dialog modal-sm" role="document">
    <div class="modal-content">
        <div class="row">
            <div class="col-md-12">
              <!--   <form action="{//:url('admin/role/update', ['id'=>$v['id']])}" onsubmit="return saveAjax()"> -->
                    <hr>
                    <div>
                        <input type="hidden" name="_method" value="PUT">
                        <input type="hidden" id="id" name="id" value="">
                        <div class="form-group">
                            <label for="" class="col-sm-2 control-label">角色ID：</label>
                            <div class="col-sm-4">
                                <input type="text" id="name" name="name" class="form-control" value="" style="width:350px;">
                            </div>
                        </div>
                        <br><br>
                        <div class="form-group">
                            <label for="" class="col-sm-2 control-label">角色名：</label>
                            <div class="col-sm-4">
                                <input type="text" id="name" name="name" class="form-control" value="" style="width:350px;">
                            </div>
                        </div>
                        <br><br>
                        <div class="form-group">
                            <label for="" class="col-sm-2 control-label">角色描述：</label>
                            <div class="col-sm-4">
                                <input  type="text" id="remark" name="remark" class="form-control" value="" style="width:350px;">
                            </div>
                        </div>
                        <br><br>    
                        <div class="form-group">
                            <label for="" class="col-sm-2 control-label">角色状态：</label>
                            <div class="col-sm-4">
                                <input  type="text" id="status" name="status" class="form-control" value="" style="width:350px;">
                            </div>
                        </div>
                        <br><br>
                        <hr>
                        <!-- <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-4">
                              <button type="submit" class="btn btn-default save-btn">保存</button>
                            </div>
                        </div> -->
                        <div class="modal-footer">
                            <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
                        </div>
                    </div>
                <!-- </form> -->
            </div>
        </div>
    </div>
  </div>
</div>
{/block}


{block name="myjs"}
{js href="/static/admin/assets/js/toastr.min.js"}
{js href="/static/admin/assets/xiaojs/admin_role.js"}
{/block}


